<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
</head>
<body>


  <div id="app">
    <button v-show="index > 0" @click="index--">上一页</button>
    <div>
      <img :src="list[index]" alt="" width="800">
    </div>
    <button v-show="index < list.length - 1" @click="index++">下一页</button>
  </div>
<!-- 需求: 通过上一页/下一页按钮,控制图片的切换,索引越界时隐藏相应按钮 -->
  <script src="./vue2.6.12.js"></script>
  <script>
    var app = new Vue({
      el:'#app',
      data:{
        // 模拟下标, 记录当前看的是第几个
        index:0,
        list:[
          './img/1.png',
          './img/2.png',
          './img/3.png'
        ]
      },
      methods:{}
    })
  </script>
</body>
</html>